import request from '@/utils/request'
import qs from 'qs'

export function getOrginSource(data) {
  return request({
    url: 'api/database',
    method: 'get',
    data
  })
}
export function getColumns(data) {
  return request({
    url: '/api/migDefItem/columns' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}
export function initSourceItems(data) {
  return request({
    url: '/api/migDefItem/initSourceItems' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}
export function getTables(data) {
  return request({
    url: '/api/migDefItem/tables' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}
// 同步数据源 的所有表结构
export function initDsTables(data) {
  return request({
    url: '/api/migDefDsTables/initTables' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}

// 执行迁移的任务
export function doMigrate(data) {
  return request({
    url: '/api/migDefMain/doMigrate' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}

// 执行迁移的任务
export function doMigJob(data) {
  return request({
    url: '/api/migJob/doMigrate' + '?' + qs.stringify(data, { indices: false }),
    method: 'get'
  })
}
